<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@ taglib prefix="s" uri="/struts-tags"%>

<html>

<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>
	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
	<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.1/themes/blitzer/jquery-ui.css" type="text/css" />
	<script src="../estilos/jquery.easy-confirm-dialog.js"></script>
	
	<script type="text/javascript">
	
		function deleteLab(codDpto, nombDpto){
			if(confirm("¿Desea eliminar "+nombDpto+ " y todos sus laboratorios?")){
				document.forms[0].typeModif.value = 'delete';
				document.forms[0].codDepto.value = codDpto;
				document.forms[0].nombreDepto.value = nombDpto;
				document.forms[0].submit();
			}
		}
	
	</script>

	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
	<link href="estilos/style.css" rel="stylesheet" type="text/css" />
	<title>LABTEC - Eliminar Departamento</title>
</head>

<body>
	<div id="header">
		    <jsp:include page="/jsp/menuAdministrador.jsp" />
	</div>
	<div class="sheet">
		<div class="sheet-tl"></div>
		<div class="sheet-tr"></div>
		<div class="sheet-bl"></div>
		<div class="sheet-br"></div>
		<div class="sheet-tc"></div>
		<div class="sheet-bc"></div>
		<div class="sheet-cl"></div>
		<div class="sheet-cr"></div>
		<div class="sheet-cc"></div>
		<div class="sheet-body">
			<h5 class="postcontent">Eliminar Departamento</h5>
			<br />

			<table class="article">
				<thead>
					<tr>
						<th>Cod. Departamento</th>
						<th>Nombre</th>
						<th></th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="listDepartamentos">
						<tr>
							<td>
								<s:property value="codDepto"/>
							</td>
							<td>
								<s:property value="nombreDepto"/>
							</td>
							<td>	
								<input type="button" value="Eliminar" id="yesno" onclick="deleteLab('<s:property value="codDepto"/>', '<s:property value="nombreDepto"/>')">
							</td>
						</tr>	
					</s:iterator>
				</tbody>
			</table>
			<s:form action="gestionDepartamentoAction">
				<s:hidden name="typeModif"></s:hidden>
				<s:hidden name="codDepto"></s:hidden>
				<s:hidden name="nombreDepto"></s:hidden>
			</s:form>
		</div>
	</div>
</body>
</html>